﻿using System;
using System.Collections.Generic;
using System.Net;
using System.Text;

namespace Xejen.Communication.Ftp
{
    /// <summary>
    /// 表示Ftp请求地址
    /// </summary>
    /// <creator>marc</creator>
    public class FtpAddress
    {
        /// <summary>
        /// 服务器文件路径或者目录路径
        /// </summary>
        public string Path { get; set; }

        /// <inheritdoc cref="FtpAddress"/>
        public FtpAddress() { }

        /// <inheritdoc/>
        public override string ToString()
        {
            return $"{nameof(Path)}:{Path}";
        }

        /// <inheritdoc/>
        public override int GetHashCode()
        {
            return (Path).GetHashCode();
        }

        /// <inheritdoc/>
        public override bool Equals(object obj)
        {
            var target = obj as FtpAddress;
            return Path.ToLower() == target.Path.ToLower();
        }
    }
}
